CREATE PROCEDURE [dbo].[sp_sec_GetResourcePermission]
@FKResource int, @FKPermission int
AS
BEGIN
  SELECT RP.PKResourcePermission, RP.FKPermission , RP.FKResource
  FROM SC_ResourcePermission RP
  WHERE FKPermission = COALESCE(@FKPermission,FKPermission)
  AND FKResource = COALESCE(@FKResource,FKResource);
END